<template>
	<view>
		<view class="title">
			{{article.vcTitle}}
		</view>
		<!-- <view class="content" v-html="article.vcContent">

		</view> -->
		<view class="px-2">
			<rich-text :nodes="article.vcContent"></rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 0,
				article: {},
				picShow: false
			}
		},
		onLoad(options) {
			let _this = this;
			_this.id = options.id;
			_this.getDetail();
		},
		methods: {
			getDetail() {
				let _this = this;

				let opts = {
					url: 'Mien/findMienFcXq.shtml'
				};
				let param = {
					longId: _this.id
				};
				_this.$http.httpRequest(opts, param).then(
					res => {
						console.log(res.data);
						if (res.data.code == '200') {
							_this.article = res.data.data;
							// _this.article.content=_this.$until.imgDeal(_this.article.content);
							// _this.article.vcContent = _this.format(_this.article.vcContent)
							// if (_this.article.vcPicUrl != '') {
							// 	_this.picShow = true
							// }
						}
					},
					error => {
						console.log(error);
					}
				)
			},
			format(msg) {
				var msg = msg.replace(/<\/?[^>]*>/g, ''); //去除HTML Tag
				msg = msg.replace(/[|]*\n/, ''); //去除行尾空格
				msg = msg.replace(/&npsp;/gi, ''); //去掉npsp
				return msg;
			}
		}
	}
</script>

<style>
	.title {
		font-size: 20px;
		font-weight: bolder;
		text-align: center;
		margin-top: 35px;
	}

	.pic {
		text-align: center;
		margin-top: 20px;
	}

	.content {
		padding: 18px;
		text-indent: 2em;
	}
</style>
